import unittest
import model
from world import world, town

def prices_are_fifty(t, tester, m):
    for good in town.ALL_GOODS:
        tester.assertTrue((t, good) in m.values)
        tester.assertEqual(m.values[(t, good)], model.GUESS_PRICE)

def costs_are_zero(route, tester, m):
    tester.assertTrue(route in m.values)
    tester.assertEqual(m.values[route], 0)

class ModelTest(unittest.TestCase):
    """Test case for the 'model' module"""
    
    
    
    def test_optimistic_model(self):
        w = world.World()
        w.populate()
        m = model.get_optimistic_model(w)
        
        w.to_all_towns(prices_are_fifty, (self, m))
        
        w.to_all_routes(costs_are_zero, (self, m))
        
        
        
        
        
        
        
        
        
        
    


if __name__ == '__main__':
    unittest.main()

def get_suite():
    return unittest.makeSuite(ModelTest)
